package com.cl.ks.controller;

import com.cl.ks.entity.KsFlowLike;
import com.cl.ks.service.KsFlowLikeService;
import com.cl.mvc.controller.JDBaseController;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("KsFlowLike")
public class KsFlowLikeController extends JDBaseController<KsFlowLike> {
    private final KsFlowLikeService ksFlowLikeService;

    public KsFlowLikeController(KsFlowLikeService ksFlowLikeService) {
        super(ksFlowLikeService);
        this.ksFlowLikeService = ksFlowLikeService;
    }

    @GetMapping("toggleLike")
    public KsFlowLike toggleLike(@RequestHeader(name = "Authorization", defaultValue = "") String auth, Integer targetId, String targetType) {
        return ksFlowLikeService.toggleLike(auth, targetId, targetType);
    }
}
